# coding: UTF-8

from django.conf.urls.defaults import *
from views import feeds_dic

urlpatterns = patterns('',
    (r'^$',                             'views.index'),
    (r'^login/$',                       'views.login'),
    (r'^robots.txt$',                   'views.robots'),
    (r'^blog/((?P<p_id>[\w-]+)/)?$',       'blog.views.index'),
    
    #编辑日志
    (r'^blog/diary/save/$',                       'blog.views.save_diary'),
    (r'^blog/diary/(?P<diary_id>[\w-]+)?/save/$',    'blog.views.save_diary'),
    (r'^blog/diary/(?P<diary_id>[\w-]+/)?delete/$', 'blog.views.delete_diary'),
    (r'^blog/diary/list/((?P<p_id>[\w-]+)/)?$', 'blog.views.list_diary'),
    
    #编辑栏目
    (r'^blog/category/(?P<category_id>[\w-]+/)?save/$',    'blog.views.save_category'),
    (r'^blog/category/(?P<category_id>[\w-]+/)?delete/$', 'blog.views.delete_category'),
    (r'^blog/category/list/$', 'blog.views.list_category'),
    
    #显示日志
    (r'^blog/diary/(?P<diary_id>[\w-]+)/$',    'blog.views.show_diary'),
    (r'^blog/category/(?P<category_id>[\w-]+)/((?P<page_id>\d+)/)?$', 'blog.views.show_category_diary_list'),
    (r'^blog/tag/(?P<tag_id>[\w-]+)/((?P<page_id>\d+)/)?$', 'blog.views.show_tag_diary_list'),
    
    #链接
    (r'^blog/link/(?P<link_id>[\w-]+/)?save/$',    'blog.views.save_link'),
    (r'^blog/link/(?P<link_id>[\w-]+/)?delete/$', 'blog.views.delete_link'),
    (r'^blog/link/list/$', 'blog.views.list_link'),
    
    #评论
    (r'^blog/(?P<diary_id>[\w-]+)/comment/save/$',           'blog.views.save_comment'),
    
    (r'^blog/tag/(?P<t_id>\d+)/((?P<p_id>\d+)/)?$',              'blog.views.tag'),
    
    
    (r'^work/$',                        'views.work'),
    
    (r'^resume/$',                      'resume.views.index'),
    
    (r'^photo/$',                       'views.photo'),
    
    #download
    (r'^download/$',                    'file.views.list_downloads'),

    #RSS & ATOM
    (r'^rss/(?P<url>.*)/$', 'syndication.views.feed', {'feed_dict': feeds_dic}),
    
)

